#pragma once

#include"RBTree.h"

namespace hcy
{
	template<class K>
	class set
	{
		struct SetKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		}; 
	public:
		typedef typename RBTree<K, const K, SetKeyOfT>::Iterator iterator;
		typedef typename RBTree<K, const K, SetKeyOfT>::Const_Iterator const_iterator;

		iterator begin()
		{
			return _rbtree.begin();
		}

		iterator end()
		{
			return _rbtree.end();
		}

		const_iterator begin() const
		{
			return _rbtree.begin();
		}

		const_iterator end() const
		{
			return _rbtree.end();
		}

		pair<iterator, bool> insert(const K& key)
		{
			return _rbtree.Insert(key);
		}

		iterator find(const K& key)
		{
			return _rbtree.Find(key);
		}
	private:
		RBTree<K, const K, SetKeyOfT> _rbtree;
	};
}